package cz.rosada.sx.library;

public class StringParser {
	
	public int index = 0;

	private String line;
	
	public StringParser(String aLine) {
		line = aLine;
	}
	
	public String readToChar(char separator) {
    	final int StartIndex = index;
    	final int LineLength = line.length();
    	while ((index < LineLength) && (line.charAt(index) != separator))
        	index++;
    	index++;
    	return line.substring(StartIndex, index - 1);
    }
	
	public void reset() {
		index = 0;
	}

	public boolean notEnd() {
		return index < line.length();
	}

}
